﻿using System.Collections.Generic;
using UnityEngine;

public enum GradientType
{
    Custom,
    Gradient,
}


    public class MonoColorScheme : MonoBehaviour, IColorScheme
    {
        public int colorIndex;
        // public List<ColorSchemeData> ColorSchemeDataList;
        public List<MaterialColorSchemeData> MaterialColorSchemeDatas;

        public void SetColor(int useColorIndex)
        {
            colorIndex = useColorIndex;
            // Motify(ColorSchemeDataList);
            Motify(MaterialColorSchemeDatas);
        }

        [ContextMenu("test color")]
        public void TestColor()
        {
            SetColor(colorIndex);
        }

        void Motify<T>(List<T> listData) where T : ColorSchemeData
        {
            foreach (var item in listData)
            {
                Motify(item);
            }
        }

        void Motify(ColorSchemeData data)
        {
            ColorModule.Instance.Motify(data, colorIndex);
        }
    }

    [System.Serializable]
    public class ColorSchemeData
    {
        public Renderer CRenderer;
        public string propertyName;
        public int matIndex = 0;

        public ColorSchemeData()
        {
        }
    }
